﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using InsuranceAdjuster.Web.Models;
//using USBMonitor;

namespace InsuranceAdjuster.Views
{
    public partial class DamageView : Page
    {
        private ViewModels.ClaimViewModel _viewModel;
        // BackgroundUSBMonitor _BackgroundUSBMonitor = null;

        public DamageView()
        {
            _viewModel = ((ViewModels.ViewModelLocator)(App.Current.Resources["Locator"])).Claim;
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            //var _BackgroundUSBMonitor = new BackgroundUSBMonitor();
            //_BackgroundUSBMonitor.USBInserted += (o1, e1) =>
            //{
            //    Dispatcher.BeginInvoke(() =>
            //        {
            //            var Path = e1.Message;
            //            _viewModel.AddUsbPhotosCommand.Execute(Path);
            //        });
            //};
            //_BackgroundUSBMonitor.Start();
        }
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            //if (_BackgroundUSBMonitor != null)
            //    _BackgroundUSBMonitor.Stop();

            base.OnNavigatingFrom(e);
        }


        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            var ThisButton = sender as HyperlinkButton;

            //_viewModel.SelectClaimDamageCommand.Execute(ThisButton.DataContext as ClaimDamage);
        }
    }
}
